package com.sunkyc.framework.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sunkyc.commons.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author sunkyc
 * @since 2022-05-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_menu")
@ApiModel(value="SysMenu对象", description="菜单权限表")
public class SysMenu  extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "菜单ID")
    @TableId(value = "menu_id", type = IdType.ASSIGN_ID)
    private Long menuId;

    @ApiModelProperty(value = "菜单类型（C菜单 F按钮）")
    @NotBlank(message = "请选择菜单类型")
    private String menuType;

    @ApiModelProperty(value = "菜单名称")
    @NotBlank(message = "请输入菜单名车/功能名称")
    private String title;

    @ApiModelProperty(value = "组件名称")
    private String menuName;

    @ApiModelProperty(value = "父菜单ID")
    private Long parentId;

    @ApiModelProperty(value = "显示顺序")
    private Integer orderNum;

    @ApiModelProperty(value = "路由地址")
    private String path;

    @ApiModelProperty(value = "组件路径")
    private String component;

    @ApiModelProperty(value = "是否为外链（0是 1否）")
    private String isLink;

    @ApiModelProperty(value = "是否内嵌，开启条件，1、isIframe:true 2、isLink：链接地址不为空")
    private String isIframe;

    @ApiModelProperty(value = "内嵌或者外联路径https/http开头")
    private String link;

    @ApiModelProperty(value = "菜单状态（0显示 1隐藏）")
    private String isHide;

    @ApiModelProperty(value = "是否缓存（0缓存 1不缓存）")
    private String isKeepAlive;

    @ApiModelProperty(value = "是否固定（0是 1否）")
    private String isAffix;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "权限标识")
    @NotBlank(message = "请输入权限标识")
    private String perms;


    @TableField(exist = false)
    private List<SysMenu> children;


}
